<template>
	<gui-page>
		<template v-slot:gBody>
			<view class="page">

				<view class="content-header gui-color-white "
					style="margin-top: 50rpx;line-height: 70rpx; margin-left: 50rpx;">
					<view>
						<text style="font-size: 60rpx;margin-right:20rpx;">{{user.chinaname}}</text>
						<text @click="is_debug=!is_debug">
							[{{user.lessee.name}}-{{user.organization}}]
						</text>
						<text class="gui-block">
							{{user.lg_id}}
						</text>
					</view>
				</view>

				<!-- 轮播图 -->
				<view style="margin-top: -180rpx;">
					<!-- previous-margin指的是当前图片的左边框距离屏幕最左边的距离 -->
					<swiper style="height: 270rpx; margin-top: 140rpx;" previous-margin="165rpx" next-margin="140rpx"
						@change="handlechange" :current="mycurrent" :indicator-dots="true" :circular="true"
						:interval="3000" :duration="1000">
						<swiper-item v-for="(item, index) in lunbotu" :key="index" @click="journalism(index)">
							<view :class="['swiper-item',index==mycurrent ? 'active' : '']">
								<img :src="item" style="width: 100%;height: 100%; border-radius: 15rpx;" alt=""
									srcset="">
							</view>
						</swiper-item>
					</swiper>
				</view>

				<view style="margin-top: 30rpx;">
					<!-- 我的缴费 -->
					<view
						style="color: #333333; margin-bottom: 20rpx; margin-left: 22rpx; font-size: 32rpx; font-weight: bold;">
						我的缴费</view>
					<view class="zuoyou">
						<image src="@/static/homePage/huadong.png" mode=""></image>
						<!-- <view>--</view>
						<image src="@/static/homePage/you.png" mode=""></image> -->
					</view>
					<scroll-view class="scroll-view_H gui-pad" scroll-x="true" @scroll="scroll">
						<view v-for="(item, idx) in payment" class="scroll-view-item_H box-shadow "
							:style="'background: url('+item.img+') 100% 100% / 100% 100%;'" @click="change_type(item)"
							:key="idx">
							<view v-if="item.title != '医疗互助金'"
								style="width: 280rpx; height: 260rpx; margin-top: 38rpx;">
								<view style="margin: 0 30rpx 0 30rpx;">{{item.title}}</view>
								<view style="margin-left: 40rpx; margin-top: 35rpx;">￥{{item.money?item.money:'无'}}
								</view>
								<view
									style="margin-left: 45rpx; margin-top: 35rpx; display: flex; align-items: center;">
									<view style="font-size: 28rpx;">查询 缴费</view>
									<image style="width: 40rpx; height: 45rpx; margin-left: 10rpx;"
										src="../../static/homePage/list.png" mode=""></image>
								</view>
							</view>
							<view style="width: 280rpx; height: 260rpx; margin-left: 18rpx;" v-else>
								<view style="margin: 16rpx 30rpx 0 15rpx;">{{item.title}}</view>
								<view style="font-size: 25rpx; margin-top: 20rpx;">
									应缴: {{hzj_data.price?item.money:0}}元
									<br>
									已缴: {{hzj_data.count?hzj_data.count:0}}次 / 共{{hzj_data.sum?hzj_data.sum:0}}元
									<br>
									还需缴: {{hzj_data.y_sum?hzj_data.y_sum:0}}元
								</view>
								<view
									style="margin-left: 25rpx; margin-top: 15rpx; display: flex; align-items: center;">
									<view style="font-size: 28rpx;">查询 缴费</view>
									<image style="width: 40rpx; height: 40rpx; margin-left: 10rpx;"
										src="../../static/homePage/list.png" mode=""></image>
								</view>
							</view>

						</view>
					</scroll-view>
				</view>

				<!-- 互助金金额选择 -->
				<view class="" v-show="pay_type == '医疗互助金' && hzj_data.count < 2">
					<view style="margin-top: 25rpx;" v-if="payment.hzj.money > 2000">
						<view
							style="color: #111852; margin-bottom: 15rpx; margin-left: 22rpx; font-size: 32rpx; font-weight: bold;">
							互助金单次支付金额选择:
						</view>
						<view class="ylhzj">
							<view class="huzhujin" v-for="(item, idx) in payment.hzj.jine" :key="idx">
								<view :class="this_index == item.num ? 'this_bg' : 'defu_bg'" @tap="hzj_money(item)">
									{{item.num}}
								</view>
							</view>
						</view>
					</view>
				</view>


				<!-- 支付方式1 -->
				<!-- <view style="margin-top: 25rpx;">
					<view
						style="color: #111852; margin-bottom: 18rpx; margin-left: 22rpx; font-size: 34rpx; font-weight: bold;">
						{{pay_type}}支付方式选择:
					</view>
					<view style="display: flex; align-items: center; justify-content: space-around;">
						<view v-for="(item, idx) in zhifufs"
							style="border: 1px solid #8F939C; border-radius: 20rpx; width: 140rpx; background-color: white;">
							<view @click="fangshi(item.text)">
								<image
									style="width: 90rpx; height: 80rpx; margin-left: 25rpx; margin-top: 20rpx; position: relative;"
									:src="item.img" mode="">
								</image>
								<image
									style="position: absolute; width: 100rpx; height: 100rpx; margin-top: 28rpx; margin-left: -90rpx;"
									v-if="item.text == current" src="@/static/homePage/gou.png" mode="">
								</image>
								<view style="font-size: 25rpx; text-align: center;">{{item.text}}</view>
							</view>
						</view>
					</view>
				</view> -->


				<!-- 支付方式2 -->
				<view style="margin-top: 25rpx;">
					
						<view>
							<view
								style="color: #333333; margin-bottom: 20rpx; margin-left: 20rpx; font-size: 32rpx; font-weight: bold;">
								{{pay_type}}支付方式：{{current}}
							</view>
							
							<view style="display: flex; justify-content: space-around;">
								<view v-for="(item2, idx) in pay_types" v-if="item2.show"
									class="gui-border gui-border-radius-large box-shadow2"
									style="width: 140rpx; background-color: white;" :key="idx">
									<view @click="change_payType(item2.text)" >
										<image
											style="width: 90rpx; height: 80rpx; margin-left: 25rpx; margin-top: 20rpx; position: relative;"
											:src="item2.img" mode="aspectFit">
										</image>
										<image
											style="position: absolute; width: 100rpx; height: 100rpx; margin-top: 28rpx; margin-left: -90rpx;"
											v-if="item2.text == current" src="@/static/homePage/gou.png" mode="">
										</image>
										<view style="font-size: 25rpx; text-align: center; color: #000;">{{item2.text}}
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				

				<view style="width: 100%; display: flex; align-items: center; margin-top: 50rpx;">
					<button @click="my_pay" class="box-shadow"
						style="border-radius: 21rpx; background-color: #FF99D3; color: white; width: 300rpx;">我要缴费</button>
					<button @click="pay_log" class="box-shadow"
						style="border-radius: 21rpx; background-color: #18C8BD; color: white; width: 300rpx;">缴费历史</button>
				</view>

				<!-- position:fixed;bottom: 20rpx; left: 0;  -->
				<!-- <image style="width: 300rpx; height: 60rpx; position: absolute;bottom: 20rpx; left: 20rpx;"
					src="https://boyaltd.oss-cn-hangzhou.aliyuncs.com/2022-05/24/HeQ8tphprZRpnU1653381364220524.png">
				</image> -->

			</view>



		</template>
		<image src="@/static/pay/lbt/WechatIMG12332.jpg" mode=""></image>
	</gui-page>
</template>


<script>
	//下单步骤 工会费(微信直缴,农行支付,微缴费小程序) 医疗互助金(农行支付,微缴费小程序) 团费(农行支付,微缴费小程序)
	//1.查询账单open(),通过money是否为null判断查询或缴费,查询赋对应值给payment
	//2.已查询，点击缴费，费用信息赋值给payInfo,打开guiactionsheet

	var ABCPay;
	var self;
	var sweixin;
	import artciles from '@/Grace6/demoData/article.js';
	export default {
		data() {
			return {
				is_debug: false,
				hzj_price: ['0.1', '2000', '3000', '5000', '10000'],
				this_index: null,
				lunbotu: [
					"http://jf2.boyaltd.cn/new_app/JFlbt/jiaofeiyouli.jpg",
					"http://jf2.boyaltd.cn/new_app/JFlbt/WechatIMG12332.jpg",
					"http://jf2.boyaltd.cn/new_app/JFlbt/WechatIMG12333.jpg",
				],
				current: '',
				mycurrent: 0,
				scrollLeft2: null,
				bg_img: "../../static/bg_pay.png",
				boyaLogoImg: "https://boyaltd.oss-cn-hangzhou.aliyuncs.com/2022-05/24/HeQ8tphprZRpnU1653381364220524.png",
				pay_types: [{
						id: 0,
						text: '微信直缴',
						img: "../../static/homePage/wx.png",
						show:false,
					},
					{
						id: 1,
						text: '农行支付',
						img: "../../static/homePage/nh.png",
						show:false,
					},
					{
						id: 2,
						text: '微缴费',
						img: "../../static/homePage/xcx.png",
						show:false,
					},
					{
						id: 4,
						text: '支付宝',
						img: "../../static/homePage/zfb.png",
						show:false,
					}
				],
				payment: {
					ghf: {
						title: "工会费",
						content: "缴费金额：",
						img: "https://boyaltd.oss-cn-hangzhou.aliyuncs.com/2022-05/23/awWn4phppkHreS1653291431220523.png",
						money: null,
						orderid: null,
						fe_id: 67,
						examine_url: '/app/bill', //查询账单信息
						// pay_url: 'https://jf.boyaltd.cn/api/app_pay',
						pay_url: 'https://jf.lgwisdomunion.cn/api/app_pay',
						merchant_id: 'JF-EPAY2021031989931',
					},
					hzj: {
						title: "医疗互助金",
						content: "缴费金额：",
						img: "https://boyaltd.oss-cn-hangzhou.aliyuncs.com/2022-05/23/hyrAwphpqVPZs71653291953220523.png",
						money: 0,
						fe_id: 86,
						examine_url: '/app/zdy_bill', //查询账单信息
						// pay_url: 'https://jf.boyaltd.cn/api/app_zdy_pay', //支付地址
						pay_url: 'https://jf.lgwisdomunion.cn/api/app_zdy_pay', //支付地址
						merchant_id: 'JF-EPAY2022010771732',
						is_pay: true, //能否缴费
						amount: '',
						jine: [{
							"num": '2000'
						}, {
							"num": '3000'
						}, {
							"num": '5000'
						}, {
							"num": '10000'
						}],
					},
					tw: {
						title: "团费",
						content: "缴费金额：",
						img: "https://boyaltd.oss-cn-hangzhou.aliyuncs.com/2022-05/23/PkGUIphpET9mpN1653292239220523.png",
						money: null,
						fe_id: 67,
						examine_url: '/twjf/bill',
						merchant_id: 'JF-EPAY2022042095221',
					},
					qt: {
						title: "其他",
						content: "缴费金额",
						fe_id: 67,
						money: null,
						examine_url: '/app/bill', //查询账单信息
						img: "https://boyaltd.oss-cn-hangzhou.aliyuncs.com/2022-05/27/LGZl6php2ueXxl1653626032220527.png",
					},
				},
				hzj_data: [],
				user: uni.getStorageSync("member"),
				payConfig: {
					wx: {
						sysId: "gh_edf4ceb10043",
						appid: "wxcf5c7da8bb74c8af",
						path: "pages/jf/wxpay"
					},
					wx_abc: {
						sysId: "gh_a6986a2f785e",
						appid: "wx78642797f4ce5e50",
						path: "page/containers/payment/query-input/query-input"
					}
				},
				pay_type: "工会费",
				sweixin: '',
				payInfo: {},
				order: {},
				dizhi: null,
				touchNum: 0,
				ceshi: {
					http: {
						externalLink: '/pages/web/page?name=测试页面'
					},
					linktype: "1",
					text: '测试页面'
				},
				yb_whether: false,
				// ceshi: {
				// 	http: {
				// 		externalLink: "#/pages/web/page?name=福利尊享"
				// 	},
				// 	linktype: "10",
				// 	src: "http://oss.boyaltd.cn/app/pw6ZD5_福利尊享.png",
				// 	text: "福利尊享",
				// }
			}
		},
		onLoad() {
			console.log('user======>', this.user);
			if (this.user.lessee.name == '博亚科技') {
				this.is_debug = true;
			}
			let that = this;
			// #ifdef APP-PLUS
			ABCPay = uni.requireNativePlugin('ABC-Pay');
			plus.share.getServices(function(s) {
				var shares = {};
				for (var i = 0; i < s.length; i++) {
					var t = s[i];
					console.log(t);
					shares[t.id] = t;
					console.log(t.id);
				}
				sweixin = shares['weixin'];
			}, function(e) {
				console.log("获取分享服务列表失败：" + e.message);
			});
			//#endif
			this.is_debug = uni.getStorageSync("is_PreviewVer");
		},
		onShow() {
			this.list_ghf(0);
			this.list_hzj(0);
			// this.list_tw();
			// this.list_yb();
		},
		onNavigationBarButtonTap(e) {
			console.log("onNavigationBarButtonTap", e);
			uni.redirectTo({
				url: "/pages/pay/ghf"
			})
		},
		methods: {
			journalism(idx) {
				console.log('轮播图点击');
				if (idx == 0) {
					uni.navigateTo({
						url: '/pages/pay/slideshow'
					})
				}
			},
			set_payType(name, items) {
				//设置可用支付类型
				let range = [];
				// this.pay_types.map(pay=>{
				// 	let item = items.find(i=>i==pay.value);
				// 		if(item){
				// 			range.push(pay);
				// 		}
				// })
				let self=this;
				//遍历数组pay_types,如果pay_types中的元素在items中存在,则将pay_types中的元素show=true
				self.pay_types.map(pay => {
					let item = items.find(i => i == pay.text);
					if (item) {
						pay.show = true;
					} else {
						pay.show = false;
					}
				})
				
				
				console.log("set_payType", self.pay_types);
			},
			list_ghf(n=1) {
				let self = this
				let item = self.payment.ghf
				let data = {
					"fe_id": item.fe_id,
					"project_name": '工会费',
					"newApp": true
				};
				console.log("list_ghf", item.examine_url);
				self.$boya.NGet(item.examine_url, data, function(res) {
					console.log('工会费res: ', res);
					// properties read
					if (res.data.hasOwnProperty('pay_types')) {
						if (res.data.fe_id != 67) {
							let substringToRemove = "微信直缴";
							res.data.pay_types = res.data.pay_types.replace(substringToRemove, "").replace(/,,/g,
								",").replace(/^,|,$/g, "");
						}
						let pay_types = res.data.pay_types.split(',');
						
						if(n==1){
							if (pay_types.length > 0) {
								self.set_payType("ghf", pay_types);
							}
						}
					}
					// self.payment.ghf.sfz = self.user.wxid;
					self.payment.ghf.money = res.data.money;
					self.payment.ghf.orderid = res.data.no;
					self.payment.ghf.merchant_id = res.data.merchant_id;
					self.payment.ghf.fe_id = res.data.fe_id;
				}, function(err) {
					
					console.log('工会费err: ', err);
					console.log(item.examine_url)
					console.log(data);
				})
				uni.hideLoading();
				// console.log('工会费：', self.payment.ghf);
			},
			list_hzj(n=1) {
				//互助金,金额运行
				let self = this
				let item = self.payment.hzj
				let data = {
					"fe_id": item.fe_id,
					"newApp": true,
				};
				//查询互助金记录,判断是否缴过,要求3次内缴完,最后一次为全部未缴费金额
				this.$boya.NGet(item.examine_url, data, function(res) {
					console.log('互助金res：', res);
					if (res.data.feeitems.hasOwnProperty('pay_types')) {
						if(n==1){
							let pay_types = res.data.feeitems.pay_types.split(',');
							if (pay_types.length > 0) {
								self.set_payType("hzj", pay_types);
							}
						}
					}
					self.payment.hzj.money = res.data.y_sum;
					console.log('self.payment.hzj.money: ', self.payment.hzj.money);
					self.hzj_data = res.data
					if (self.payment.hzj.money == undefined) {
						//未缴纳,首次金额随便
						self.payment.hzj.amount = null
					} else {
						if (self.payment.hzj.money < 2000 || res.data.count == 2) {
							self.payment.hzj.amount = self.payment.hzj.money
							self.this_index = self.payment.hzj.money
						} else {
							self.payment.hzj.amount = 0
						}
					}
					console.log('self.payment.hzj.amount,self.payment.hzj.amount: ', self.payment.hzj.amount);
					let y_y_sum = parseFloat(res.data.y_sum);
					console.log('y_y_sum： ', y_y_sum);
					if (y_y_sum == 0) {
						// self.$boya.msg('您的缴费已达上限！')
						self.payment.hzj.is_pay = false
					} else {
						if (res.data.count > 1) {
							self.hzj_price = [y_y_sum];
						} else {
							//操作除去大于须缴金额的元素
							let hzj_price_arr = [];
							for (let i = 0; i < self.hzj_price.length; i++) {
								if (self.hzj_price[i] <= y_y_sum) {
									hzj_price_arr.push(self.hzj_price[i]);
								}
							}
							self.hzj_price = hzj_price_arr;
						}
					}
				}, null, {
					showError: false
				})
				uni.hideLoading();
				console.log('互助金：', self.payment.hzj);
			},
			list_tw() {
				//团费
				let self = this
				let item = self.payment.tw
				let data = {
					"fe_id": item.fe_id,
					"newApp": true
				};
				console.log('这里这里');
				this.$boya.NGet(item.examine_url, data, function(res) {
					console.log('团费res：', res);
					if (res.data == "﻿overtime") {
						console.log("当前为结算时间！");
						uni.showToast({
							title: "当前为结算时间！",
							icon: 'none'
						})
						return;
					} else {
						// '农行支付', 
						let pay_types = ['微缴费'];
						if (pay_types.length > 0) {
							self.set_payType("tw", pay_types);
						}
						let d = res.data.split(",");
						if (d.length > 1) {
							if (d[0] > 0 && d[1]) {
								self.payment.tw.money = d[0];
								self.payment.tw.orderid = d[1];
							}
						}
					}
				}, null, {
					showError: false
				});
				uni.hideLoading();
				console.log('团费：', self.payment.tw);
			},
			// list_yb() {
			// 	// 自治区医保
			// 	let self = this
			// 	let item = self.payment.yb
			// 	let data = {
			// 		"fe_id": item.fe_id,
			// 		"project_name": '医保',
			// 		"newApp": true
			// 	};
			// 	console.log("list_yb", item.examine_url);
			// 	self.$boya.NGet(item.examine_url, data, function(res) {
			// 		console.log('自治区医保res: ', res);
			// 		if (res.data.hasOwnProperty('pay_types')) {
			// 			let pay_types = res.data.pay_types.split(',');
			// 			if (pay_types.length > 0) {
			// 				self.set_payType("yb", pay_types);
			// 			}
			// 		}
			// 		self.payment.yb.money = res.data.money;
			// 		self.payment.yb.orderid = res.data.no;
			// 		self.payment.yb.merchant_id = res.data.merchant_id;
			// 		self.payment.yb.fe_id = res.data.fe_id;
			// 		self.yb_whether = true
			// 		uni.hideLoading();
			// 	}, function(err) {
			// 		console.log('自治区医保err: ', err);
			// 	}, false, false)
			// },
			change_type(item) {
				console.log('item.title： ', item.title);
				// 选择缴费项目/类型
				uni.showLoading({
					title: '加载中'
				});
				// this.current = '农行支付'
				this.current = ''
				this.this_index = 0
				this.pay_type = item.title
				if (item.title == '工会费') {
					this.list_ghf();
				} else if (item.title == '医疗互助金') {
					this.list_hzj();
				} else if (item.title == '团费') {
					this.list_tw();
				} else if (item.title == '自治区医保') {
					if (this.yb_whether == true) {
						uni.hideLoading();
						uni.navigateTo({
							url: '/pages/pay/medical_insurance'
						})
					} else {
						this.list_yb();
					}
				} else {
					this.$boya.msg('暂无账单')
				}
				this.payInfo = item;
				// console.log('payInfo: ', this.payInfo);
			},
			hzj_money(item) {
				console.log("hzj_money", item);
				let num = Number(item.num)
				let money = Number(this.payment.hzj.money)
				if (num > money) {
					this.$boya.msg('所选金额超过需支付金额，请重新选择');
				} else {
					this.this_index = item.num;
					this.payment.hzj.amount = item.num
					this.payInfo.amount = money;
				}
			},
			change_payType(text) {
				this.current = text;
				console.log("选择支付方式", this.current);
			},
			radioChange: function(evt) {
				console.log('shuju: ', evt);
				// for (let i = 0; i < this.items.length; i++) {
				// 	if (this.items[i].value === evt.detail.value) {
				// 		this.current = i;
				// 		break;
				// 	}
				// }
			},
			handlechange(e) {
				this.mycurrent = e.detail.current
			},
			scroll(e) {
				// console.log(e)
				this.scrollLeft = e.detail.scrollLeft
			},


			pay_log() {
				//缴费记录
				uni.navigateTo({
					url: '/pages/pay/pay_history'
				})
			},
			my_pay() {
				// 我要缴费
				let self = this
				let money = null
				console.log("my_pay->payInfo", this.payInfo);
				if (self.payInfo.title == '医疗互助金') {
					money = this.this_index;
				} else {
					money = self.payInfo.money
				}

				if (self.payInfo.title == null) {
					self.$boya.msg('请点击需要缴费的种类，并选择支付方式')
				} else if (!money) {
					self.$boya.msg('您未选择支付金额或已支付完成')
				} else if (money == null) {
					self.$boya.msg('无缴费账单')
				} else if (self.current == null) {
					self.$boya.msg('请选择支付方式')
				} else {
					uni.showModal({
						title: '提示',
						content: '您确定使用' + self.current + '缴纳' + self.payInfo.title + ': ' + money + '元吗？',
						success: function(res) {
							if (res.confirm) {
								if (self.payInfo.title == '医疗互助金') {
									self.hzj_pay(money);
								} else {
									self.to_pay();
								}
							} else if (res.cancel) {
								self.$boya.msg('您已取消支付')
							}
						}
					});
				}
			},
			hzj_pay(money) {
				let self = this
				let url = "/hzj/create_pay";
				let parm = {
					money: money,
					fe_id: 86,
					type: 'app'
				}
				if (self.current == "微缴费") {
					parm["type"] = "miniPay"
				}
				console.log("hzj_pay->parm", parm);
				console.log("hzj_pay->url", url);
				this.$boya.NPost(url, parm, function(res) {
					console.log("hzj_pay", res);
					if (self.current == "微缴费") {
						self.abc_mini_pay();
					} else {
						self.abcApp(res.data.token);
					}
				})
				return;
			},
			to_pay() {
				//开始支付
				// this.$boya.msg('暂未开放')
				let self = this
				if (self.payInfo.orderid) {
					console.log(self.payInfo);
					this.$boya.NGet("/app/pay/order_query", self.payInfo, function(res) {
						console.log(res);
						//订单已经支付
						self.$boya.msg(res.msg);
					}, function() {
						console.log('缴费方式：', self.current);
						//订单未支付
						switch (self.current) {
							case '微信直缴':
								//微信直缴-转到柳钢之家小程序续费
								self.wx_mini_pay()
								break;
							case '农行支付':
								self.abc_pay();
								//农行支付
								break;
							case '微缴费':
								self.abc_mini_pay()
								//农行微缴费小程序
								break;
							case '支付宝':
								self.$boya.msg('未开放')
								return
								// this.aliPay()
								//支付宝
								break;
						}
					})
				}
			},
			open: function(item, index) {
				console.log("open", item, index);
				if (item.title == '其它') {
					this.$boya.msg('未开放')
					return
				}
				if (item.money) { //第二次点击，打开支付方式
					this.payInfo = item;
					if (item.fe_id == '86') {}
					if (item == "工会费") this.pay_type = "ghf";
					if (item == "团费") this.pay_type = "tw";
					if (item == "医疗互助金") this.pay_type = "hzj";
					if (item == "其它") this.pay_type = "other";
					this.$refs.guiactionsheet.open();
				} else {
					//第一次点击，查询账单 
					let self = this;
					let data = {
						"name": this.user.name,
						"fe_id": item.fe_id,
						"newApp": true
					};

					switch (item.title) {
						case "工会费":
							this.pay_type = "ghf";
							this.$boya.NGet(item.examine_url, data, function(res) {
								// self.payment.ghf.sfz = self.user.wxid;
								self.payment.ghf.money = res.data.money;
								self.payment.ghf.orderid = res.data.no;
							})
							break;
						case "团费":
							this.pay_type = "tw";
							this.$boya.NGet(item.examine_url, data, function(res) {
								if (res.data[0] > 0 && res.data[1]) {
									self.payment[index].money = res.data[0];
								}
							})
							break;
						case "医疗互助金":
							this.pay_type = "hzj";
							this.$boya.NGet(item.examine_url, data, function(res) {
								self.payment.hzj.money = res.data.y_sum;
								self.hzj_data = res.data
							})
							break;
						default:
							break;
					}
				}
			},
			wx_pay() {
				console.log("wx_pay");
				let data = {
					"money": 0.01,
					"orderid": "no202304010307001",
					"fe_id": 67
				}
				uni.requestPayment({
					"provider": "wxpay",
					"orderInfo": {
						"appid": this.payConfig.appid, // 微信开放平台 - 应用 - AppId，注意和微信小程序、公众号 AppId 可能不一致
						"noncestr": "c5sEwbaNPiXAF3iv", // 随机字符串
						"package": "Sign=WXPay", // 固定值
						"partnerid": "148*****52", // 微信支付商户号
						"prepayid": "wx202254********************fbe90000", // 统一下单订单号 
						"timestamp": 1597935292, // 时间戳（单位：秒）
						"sign": "A842B45937F6EFF60DEC7A2EAA52D5A0" // 签名，这里用的 MD5/RSA 签名
					},
					success(res) {},
					fail(e) {}
				})
			},
			// 农行支付1
			abc_pay() {
				let self = this
				let data = {
					money: self.payInfo.money,
					orderid: self.payInfo.orderid,
					fe_id: self.payInfo.fe_id
				}
				console.log("app_pay=>", data)
				let url = "/app/abc/app_order"
				if (this.pay_type == "工会费") {
					url = "/app/abc/fee/app_pay";
				}
				if (this.pay_type == "互助金") {
					url = "/app/abc/hzj_order";
				}
				if (this.pay_type == "自治区医保") {
					url = "/app/abc/qyb_order";
				}
				console.log('url', url);
				self.$boya.NGet(url, data, function(res) {
					console.log('农行res: ', res);
					self.abcApp(res.data.token);
				}, function(err) {
					console.log('农行err: ', err);
					console.log()
					self.$boya.msg('请稍后再试');
				})
			},
			// 农行支付2
			abcApp(token) {
				var ret = ABCPay.isBankABCAvaiable();
				if (ret == true) {
					//发起支付
					  // token="17377461757143874023";
					console.log("发起支付abcApp",token);
					ABCPay.startBankABC({
						//appID:"com.example.caller",//第三方APP的应用标识。iOS无此项内容；Android默认为第三方apk的包名，(可选)
						//Method:"pay",//业务类型。目前支持的取值仅为pay，表示是支付交易。默认值pay，(可选)
						CallbackID: "com.boya.app", //支付完成后回调用的id。iOS为第三方app的schema，(iOS必需，Android可选)
						TokenID: token //支付订单号(必需)
					}, function(res) {
						if (res.code == 0) {
							//支付结果
							console.log(res.data);
						} else {
							uni.showModal({
								content: res.data
							});
						}
					});
				} else {
					this.$boya.msg('未安装农行掌银,或版本不支持');
				}
			},
			// 微信直缴
			wx_mini_pay() { //转到柳钢小程序支付
				var self = this;
				// console.log('数据：', self.payInfo.money + "-" + self.payInfo.orderid + "-0");
				let title = self.payInfo.title
				// console.log("title", title);
				let code = self.payInfo.money + "-" + self.payInfo.orderid + "-0";
				console.log("code", code);
				console.log("path", self.payConfig.wx.path + "?code=" + code + "&title=" + title);
				//#ifdef APP-PLUS
				console.log(sweixin);
				sweixin ? sweixin.launchMiniProgram({
					id: self.payConfig.wx.sysId,
					path: self.payConfig.wx.path + "?code=" + code + "&title=" + title
				}) : plus.nativeUI.alert('当前环境不支持微信操作!');
				//#endif
			},
			// 农行微缴费小程序
			abc_mini_pay() {
				var self = this;
				console.log('self.payInfo.merchant_idself.payInfo.merchant_id: ', self.payInfo.merchant_id);
				//#ifdef APP-PLUS
				this.$comm.log("swexin:" + self.payConfig.wx_abc.path + "?code=" + self.payInfo.merchant_id);
				console.log(sweixin);
				sweixin ? sweixin.launchMiniProgram({
					id: self.payConfig.wx_abc.sysId,
					path: self.payConfig.wx_abc.path + "?code=" + self.payInfo.merchant_id
				}) : plus.nativeUI.alert('当前环境不支持微信操作!');
				//#endif  
			},
			// 支付宝
			aliPay() {

			}
		}

	}
</script>

<style>
	.bg_opacity {
		opacity: 0.8;
		background-color: white;
	}

	.page {
		width: 100vw;
		height: 110vh;
		/* background-image: url('../../static/jf_backimg.png'); */
		background: url('http://boyaltd.oss-cn-hangzhou.aliyuncs.com/2022-05/24/dd1YCphpVyU8Rv1653380421220524.png') 100% 100% / 100% 100%;
		position: absolute;
	}

	.content-header {
		width: 90%;
		height: 200rpx;
	}

	.m-20 {
		margin: 20rpx 20rpx 0 0;
	}

	.Payment {
		width: 100%;
		justify-content: space-around;
		margin-top: 20rpx;
	}

	.Payment-item {
		width: 100%;
		justify-content: center;
		display: flex;
		flex-wrap: wrap;
	}

	.Payment-content {
		width: 300rpx;
		height: 300rpx;
		margin-top: 40rpx;
		border-radius: 20rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
		/* justify-content: center; */
	}

	.justify-s-a {
		justify-content: space-around;
	}

	.zuoyou {
		display: flex;
		align-items: center;
		position: absolute;
		margin-top: -58rpx;
		right: 20rpx;
	}

	.zuoyou>image {
		width: 50rpx;
		height: 35rpx;
	}

	.scroll-view_H {
		width: 100%;
		color: white;
		white-space: nowrap;
	}

	.scroll-view-item_H {
		display: inline-block;
		width: 280rpx;
		height: 260rpx;
		margin: 0 20rpx;
		border-radius: 33rpx;
	}

	.swiper-item {
		/* border-radius: 30rpx; */
		overflow: hidden;
		/* 像这种多张轮播图同时出现在一屏的情况下就不要指定width了，不然你会发现previous-margin和 next-margin会出现想不到的效果 */
		/* 如果想要设置宽每一张轮播图的宽度，只需要设置previous-margin和next-margin就可以了，想要设置高度直接改下面的height就可以了 */
		width: 420rpx;
		height: 100%;
		transform: scale(0.8);
		transition: all 0.5s ease;
		text-align: center;
		transition: all 0.5s ease-in-out;

		&.active {
			transform: scale(1);
		}
	}

	.ylhzj {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-around;
		margin-top: 10rpx;
	}

	.huzhujin>view {
		/* width: 100%; */
		text-align: center;
		height: 60rpx;
		line-height: 60rpx;
		padding: 6rpx 32rpx;
		font-size: 34rpx;
		/* font-weight: bold; */
		border-radius: 20rpx;
	}

	.this_bg {
		background-color: #A89AFC;
		color: #fff;
		box-shadow: 5rpx 5rpx 10rpx #A89AFC;
		border: 1px solid #A38AFC;
	}

	.defu_bg {
		color: #000;
		background-color: white;
		border: 1px solid #A38AFC;
	}
</style>